<?php

// sample url: http://data/index.php?/show/homepage
session_start();

if(!isset($_SESSION['libpth'])){
	$_SESSION['libpth'] = new LibraryPathFactory('/home/ludo/public_html');
}else{
	//TODO: Remove at the end of dev
	$_SESSION['libpth'] = new LibraryPathFactory('/home/ludo/public_html');
}
function __autoload($className)
{

	loadClass($className);
}
function loadClass($className) {
	$pth= null;
	if ($className == "LibraryPathFactory"){
		$pth = 'factories/LibraryPathFactory.php';
	}else{
		$obj = $_SESSION['libpth'];
		$pth = $obj->getPath($className);
	}
	if(is_null($pth)){
		$pth=str_replace('_', '/', $className).".php";
	}

	include_once($pth);
}

$control=new Controler();
//TODO: menu gauche must only display 2 level of recursivity even if 2nd level is a doc, then display doc name in menu(with selected state)
//TODO: when changing language from document display, breadcrumb info dont update to new language doc title, url neither: don't use url for breadcrumb display and find a way to change url in return
//TODO: TypeEntite must not be multilingual.
//TODO: update all bean and maybe dao to use translator and not session translator (throw translator key as exception message)
//TODO: add entite.default_recording_category_id field (when recording a document for given entite, if form entite's def_record_id is null =>> system ask where to record!)
//TODO: add entite.is_static boolean field (true = contenu; false = formulaire)
//TODO: update DAO and beans to take care of DOcument Type
//TODO: correct bug: At first site viewing , session langue does not exists.
?>